﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Numerics;

namespace WaveSim.Extensions.LabView.Providers
{
    public class ComplexNumbersProvider
    {
        public double[] Magnitude(Complex[] sourceArr)
        {
            double[] targetArr = new double[sourceArr.Length];
            for (int i = 0; i < targetArr.Length; i++)
            {
                targetArr[i] = sourceArr[i].Magnitude;
            }
            return targetArr;
        }

        public double[] Real(Complex[] sourceArr)
        {
            double[] targetArr = new double[sourceArr.Length];
            for (int i = 0; i < targetArr.Length; i++)
            {
                targetArr[i] = sourceArr[i].Real;
            }
            return targetArr;
        }

        public double[] Imaginary(Complex[] sourceArr)
        {
            double[] targetArr = new double[sourceArr.Length];
            for (int i = 0; i < targetArr.Length; i++)
            {
                targetArr[i] = sourceArr[i].Imaginary;
            }
            return targetArr;
        }
    }
}
